<%--
  Created by IntelliJ IDEA.
  author: Jsonor
  date: 2018/5/29 14:54
  description: Description
--%>
<%@ page contentType="text/html;charset=UTF-8" isELIgnored="false" %>
<html>
<head>
  <title>支付</title>
  <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/head.css" />
  <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/footer.css" />
  <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/suercenter.css" />
</head>
<body>
<%@include file="menu.jsp"%>
<div class="w1000 ClearFix margin_top20">
  <div class="ur_right">
    <div class="ur_location">
      <a href="">我的购物</a>
      <span>&gt;</span>
      <a class="a_cur">我的订单</a>
    </div>
    <div class="ur_r_list">
      <table class="order_table">
        <thead class="thead">
        <tr>
          <td class="padding_40">
            <div class="select_div">
              <div class="select_h2">
                <span>图片</span>
              </div>
            </div>
          </td>
          <td>订单单价</td>
          <td>订单数量</td>
          <td>订单金额</td>
          <td>评价状态</td>
        </tr>
        </thead>
        <tbody>
        <!--单号 时间-->
        <c:forEach var="o" items="${order}">
          <tr class="tr_top" style="background: blanchedalmond;">
            <td colspan="6">
              <span class="number">订单号：<a target="_blank" href="">${o.oid}</a></span>
              <span class="dealtime" title="状态"> 状态:
                  <c:if test="${o.state==1}">
                    <a href="${pageContext.request.contextPath}/payment.do?oid=${o.oid}"><font color="red">付款</font></a>
                  </c:if>
                  <c:if test="${o.state==2}">已经付款</c:if>
                  <c:if test="${o.state==3}">
                    <a href="${pageContext.request.contextPath}/.......?oid=${o.oid}"><font color="red">
                      确认收货</font></a>
                  </c:if>
                  <c:if test="${o.state==4}">交易完成</c:if>
                    </span>
            </td>
            <td colspan="6">
              <div class="operate">
                <p><a href="javascript:void(0);" class="btn-del"><i class="icon-trash"></i>删除</a></p>
              </div>
            </td>
          </tr>
          <!--单号 时间-->
          <!--订单商品-->
          <c:forEach var="os" items="${o.orderItemList}">
            <tr class="tr_bd">
              <td class="goods-item">
                <div class="p-img">
                  <a href="${pageContext.request.contextPath}/item.do?pid=${os.car.carid}" target="_blank">
                    <img class="" src="${pageContext.request.contextPath}/${os.car.carimages}" title="" height="60" width="60">
                  </a>
                </div>
                <div class="p-msg">
                  <div class="p-name">
                    <a href="" class="a-link" target="_blank" title="">${os.car.carname}</a>
                  </div>
                </div>
              </td>
              <td>
                <div class="goods_price">￥${os.car.caroriginalprice}万</div>
              </td>
              <td>
                <div class="goods-number">x${os.count}</div>
              </td>
              <td rowspan="1">
                <div class="amount"><span>￥${os.car.caroriginalprice*os.count}万</span><br>（免运费）<br>在线支付</div>
              </td>
              <td rowspan="1">
                <div class="status">
                  <c:choose>
                    <c:when test="${orderItems.osatate == 1}">
                      <a href="${pageContext.request.contextPath}/evaluate_findByPid?pid=${orderItems.product.pid}&itemid=${orderItems.itemid}">去评价</a>
                    </c:when>
                    <c:when test="${orderItems.osatate == 3}">评价成功</c:when>
                    <c:otherwise>
                      暂无操作
                    </c:otherwise>
                  </c:choose>
                </div>
            </tr>
          </c:forEach>
          <!--订单商品-->
        </c:forEach>
        </tbody>
      </table>
    </div>
    <!--page-->
    <!--分页-->
    <c:choose>
      <c:when test="${pg.pages<=10}">
        <c:set var="begin" value="1"/>
        <c:set var="end" value="${pg.pages}"/>
      </c:when>
      <c:otherwise>
        <c:set var="begin" value="${pg.pageNum-5}"/>
        <c:set var="end" value="${pg.pageNum+4}"/>
        <c:if test="${begin<1}">
          <c:set var="begin" value="1"/>
          <c:set var="end" value="10"/>
        </c:if>
        <c:if test="${end>pg.pages}">
          <c:set var="begin" value="${pg.pages-9}"/>
          <c:set var="end" value="${pg.pages}"/>
        </c:if>
      </c:otherwise>
    </c:choose>
    <div class="page_list margin_top20">
      <div class="page_r">
        <ul>
          <c:if test="${pg.pageNum ne 1}">
            <li class="pre a_btn un">
              <a href="${pageContext.request.contextPath}/orderAll.do?page=1"><span>首页</span></a>
            </li>
            <li class="pre a_btn un">
              <a href="${pageContext.request.contextPath}/orderAll.do?page=${pge.prePage}"><span><b><</b>上一页</span></a>
            </li>
          </c:if>
          <c:forEach var="num" begin="${begin}" end="${end}">
            <c:choose>
              <c:when test="${num eq pg.pageNum}">
                <li class="a_p_num">
                  <span>${num}</span>
                </li>
              </c:when>
              <c:otherwise>
                <li>
                  <a href="${pageContext.request.contextPath}/orderAll.do?page=${num}"><span>${num}</span></a>
                </li>
              </c:otherwise>
            </c:choose>
          </c:forEach>
          <c:if test="${pg.pages ne pg.pageNum}">
            <li class="next a_btn">
              <a href="${pageContext.request.contextPath}/orderAll.do?page=${pg.nextPage}"><span>下一页<b>></b></span></a>
            </li>
            <li class="next a_btn">
              <a href="${pageContext.request.contextPath}/orderAll.do?page=${pg.pages}"><span>尾页</span></a>
            </li>
          </c:if>
        </ul>
      </div>
    </div>
    <!--分页end-->
    <!--pageend-->
  </div>
</div>
<%@ include file="bottom.jsp" %>
</body>
</html>
